<template>
  <div id="root">
    <button @click="getProducts">获取产品信息</button>
  </div>
</template>

<script>
import axios from 'axios';
export default {
  name: "App",
  components: {
    
  },
  data() {
    return {
      welcomeMsg: "欢迎学习Vue!",
    };
  },
  mounted(){
    
  },
  beforeDestroy(){
    
  },
  created(){
    
  },
  destroyed(){
    
  },
  beforeRouteLeave (to, from, next) {
    // ...
    next(false);
  },
  methods: {
    getProducts(){
      axios.get('http://localhost:8080/api/product/list').then(
        response=>{
          console.log(response)
        },
        error => {
          console.log(error)
        }
      )
    }
  },
  watch: {
    
  },
};
</script>

<style>
/* base */
body {
  background: #fff;
}

</style>